{% if type == 'course' %}
  {% set title = course.title %}
  {% set summary = course.about|plain_text(50) %}
  {% set message = setting('default.courseShareContent')|default('我正在学习{{course}}，收获巨大哦，一起来学习吧！')|simple_template({course: '《' ~ course.title ~ '》'}) %}
  {% set url = url('course_show', {id:course.id}) %}
  {% set picture = filepath(course.largePicture, 'course.png') %}
{% elseif type == 'classroom' %}

  {% set title = classroom.title %}
  {% set summary = classroom.about|plain_text(50) %}
  {% set message = setting('default.classroomShareContent')|default('我正在学习{{classroom}}，收获巨大哦，一起来学习吧！')|simple_template({classroom: '「' ~ classroom.title ~ '」'}) %}
  {% set url = url('classroom_show', {id:classroom.id}) %}
  {% set picture = filepath(classroom.largePicture, 'classroom.png') %}

{% elseif type ==  'article' %}
  {% set title = article.title %}
  {% set summary = article.body|plain_text(50) %}
  {% set message = setting('default.articleShareContent')|default('我正在看{{articletitle}}，关注{{sitename}}，分享知识，成就未来。')|simple_template({articletitle: '「' ~ article.title ~ '」' , sitename: '「' ~ setting('site.name') ~ '」' }) %}
  {% set url = url('article_detail', {id:article.id}) %}
  {% set picture = '' %}
{% elseif type == 'group_thread' %}
  {% set title = thread.title %}
  {% set summary = thread.content|plain_text(50) %}
  {% set message = setting('default.groupShareContent')|default('我正在{{groupname}}小组，看到{{threadname}}，很不错哦，一起来看看吧！')|simple_template({threadname: '「' ~ thread.title ~ '」' , groupname: '「' ~ group.title ~ '」' }) %}
  {% set url = url('group_thread_show', {id:group.id, threadId:thread.id}) %}
  {% set picture = '' %}
{% endif %}

<div class="dropdown-menu {% if right|default(false) %}pull-right{% endif %} js-social-share-params" data-title="{{ title }}" data-summary="{{ summary|default('') }}" data-message="{{ message }}" data-url="{{ url }}" data-picture="{{ picture|default('') }}">

  <a href="javascript:;" class="js-social-share" data-cmd="weixin" title="分享到微信" data-share="weixin" data-qrcode-url="{{ path('common_qrcode',{text:url}) }}"><i class="es-icon es-icon-weixin"></i></a>
  <a href="javascript:;" class="js-social-share" data-cmd="tsina" title="分享到新浪微博" data-share="weibo"><i class="es-icon es-icon-weibo"></i></a>
  <a href="javascript:;" class="js-social-share" data-cmd="qq" title="分享到QQ好友" data-share="qq"><i class="es-icon es-icon-qq"></i></a>
  <a href="javascript:;" class="js-social-share" data-cmd="qzone" title="分享到QQ空间" data-share="qzone"><i class="es-icon es-icon-qzone"></i></a>

</div>

{{ load_script('common/share-dropdown') }}
